package hu.berczi.Utils.Coordinates.planar;

import java.awt.geom.Point2D;

public class Coordinate {
	private double x;
	private double y;

	public Coordinate(double x, double y) {
		this.x = x;
		this.y = y;

	}

	public Coordinate() {
		this(0.0, 0.0);
	}

	public double getX() {
		return x;
	}

	public double getY() {
		return y;
	}

	public void setX(double x) {
		this.x = x;
	}

	public void setY(double y) {
		this.y = y;
	}

	public void addX(double x) {
		this.x += x;
	}

	public void addY(double y) {
		this.y += y;
	}

	public double distance(Point2D another) {
		double dist = (double) (Math.pow(
				(Math.pow(this.x - another.getX(), 2) + Math.pow(this.y
						- another.getY(), 2)), 0.5));
		return dist;

	}

}
